dzmjNamespace.FenghaoLayer = cc.Layer.extend({
    ctor: function () {
        this._super();

        this.init();

        return true;
    },

    init: function () {
        //背景
        var background = new cc.Sprite(dzmjNamespace.ty.Ty_jumpBackground);
        background.attr({
            x: cc.winSize.width / 2,
            y: cc.winSize.height / 2
        });
        this.addChild(background);

        //info1
        var info1 = new cc.Sprite(dzmjNamespace.ty.Ty_kick);
        info1.attr({
            x:70,
            y:160,
            anchorX:0,
            anchorY:0
        });
        background.addChild(info1);

        ////info2
        //var info2 = new cc.Sprite(dzmjNamespace.ty.Ty_GMNumber);
        //info2.attr({
        //    x:60,
        //    y:140,
        //    anchorX:0,
        //    anchorY:0
        //});
        //background.addChild(info2);

        //确定
        var confirmItem = new cc.MenuItemImage(dzmjNamespace.ty.Ty_jumpOK, dzmjNamespace.ty.Ty_jumpOK, this.confirmCallbackFunction, this);
        confirmItem.attr({
            x: 141 / 2,
            y: 68 / 2
        });
        var confirmMenu = new cc.Menu(confirmItem);
        confirmMenu.attr({
            x: 200,
            y: 35
        });
        background.addChild(confirmMenu);
    },

    confirmCallbackFunction: function (sender) {
        cc.log("确定");

        dzmjNamespace.setMenuEnable(sender);

        cc.director.end();
    },

    onEnterTransitionDidFinish: function () {
        this._super();

        this.scheduleOnce(function () {
            cc.director.end();
        }, 5);
    }
});

dzmjNamespace.OtherUserLayer = cc.Layer.extend({
    ctor: function () {
        this._super();

        this.init();

        return true;
    },

    init: function () {
        //背景
        var background = new cc.Sprite(dzmjNamespace.ty.Ty_jumpBackgroundNo);
        background.attr({
            x: cc.winSize.width / 2,
            y: cc.winSize.height / 2
        });
        this.addChild(background);

        //info1
        var info1 = new cc.Sprite(dzmjNamespace.ty.Ty_otherLog);
        info1.attr({
            x:160,
            y:170,
            anchorX:0,
            anchorY:0
        });
        background.addChild(info1);

        ////info2
        //var info2 = new cc.Sprite(dzmjNamespace.ty.Ty_GMNumber);
        //info2.attr({
        //    x:60,
        //    y:140,
        //    anchorX:0,
        //    anchorY:0
        //});
        //background.addChild(info2);

        //确定
        var confirmItem = new cc.MenuItemImage(dzmjNamespace.ty.Ty_jumpOk1, dzmjNamespace.ty.Ty_jumpOk1, this.confirmCallbackFunction, this);
        confirmItem.attr({
            x: 205 / 2,
            y: 88 / 2
        });
        var confirmMenu = new cc.Menu(confirmItem);
        confirmMenu.attr({
            x: 190,
            y: 35
        });
        background.addChild(confirmMenu);
    },

    confirmCallbackFunction: function (sender) {
        cc.log("确定");

        dzmjNamespace.setMenuEnable(sender);

        dzmjNamespace.Reconnect();

        //this.getParent().removeFromParent(true);
        //
        //var runningScene = cc.director.getRunningScene();
        //var tyModelLayer1 = new dzmjNamespace.TyModelLayer1();
        //var tyModelLayer = new dzmjNamespace.TyModelLayer();
        //tyModelLayer.setTouchArea(cc.size(578, 511), cc.p(352, 133));
        //tyModelLayer1.addChild(tyModelLayer);
        //runningScene.addChild(tyModelLayer1, 10);
        //
        //var tyLoginLayer = new dzmjNamespace.TyLoginLayer();
        //tyLoginLayer.attr({
        //    x: 0,
        //    y: cc.winSize.height
        //});
        //tyModelLayer.addChild(tyLoginLayer);
        //
        //tyLoginLayer.runAction(cc.moveBy(20 / 60, cc.p(0, -cc.winSize.height)).easing(cc.easeBackOut()));
    }
});

dzmjNamespace.CannotLogLayer = cc.Layer.extend({
    ctor: function () {
        this._super();

        this.init();

        return true;
    },

    init: function () {
        //背景
        var background = new cc.Sprite(dzmjNamespace.ty.Ty_jumpBackground);
        background.attr({
            x: cc.winSize.width / 2,
            y: cc.winSize.height / 2
        });
        this.addChild(background);

        //info1
        var info1 = new cc.Sprite(dzmjNamespace.ty.Ty_cannotLog);
        info1.attr({
            x:70,
            y:160,
            anchorX:0,
            anchorY:0
        });
        background.addChild(info1);

        ////info2
        //var info2 = new cc.Sprite(dzmjNamespace.ty.Ty_GMNumber);
        //info2.attr({
        //    x:60,
        //    y:140,
        //    anchorX:0,
        //    anchorY:0
        //});
        //background.addChild(info2);

        //确定
        var confirmItem = new cc.MenuItemImage(dzmjNamespace.ty.Ty_jumpOK, dzmjNamespace.ty.Ty_jumpOK, this.confirmCallbackFunction, this);
        confirmItem.attr({
            x: 141 / 2,
            y: 68 / 2
        });
        var confirmMenu = new cc.Menu(confirmItem);
        confirmMenu.attr({
            x: 200,
            y: 35
        });
        background.addChild(confirmMenu);
    },

    confirmCallbackFunction: function () {
        cc.log("确定");

        cc.director.end();
    },

    onEnterTransitionDidFinish: function () {
        this._super();

        this.scheduleOnce(function () {
            cc.director.end();
        }, 5);
    }
});
